import * as request from "@/utils/request"

const apiPrefix = "/api/questionBank"

/**
 * 分页查询题库（管理员）
 */
export function listQuestionBankByPage(params: QuestionBankQueryRequest) {
  return request.post<PageQuestionBank>({
    url: apiPrefix + "/list/page",
    data: params
  })
}

/**
 * 删除题库
 */
export function deleteQuestionBank(params: DeleteRequest) {
  return request.post<boolean>({
    url: apiPrefix + "/delete",
    data: params
  })
}

/**
 * 添加题库
 */
export function addQuestionBank(params: QuestionBankAddRequest) {
  return request.post<number>({
    url: apiPrefix + "/add",
    data: params
  })
}

/**
 * 更新题库
 */
export function updateQuestionBank(params: QuestionBankUpdateRequest) {
  return request.post<boolean>({
    url: apiPrefix + "/update",
    data: params
  })
}

/**
 * 分页查询题库（用户）
 */
export function listQuestionBankVOByPage(params: QuestionBankQueryRequest) {
  return request.post<PageQuestionBankVO>({
    url: apiPrefix + "/list/page/vo",
    data: params
  })
}

/**
 * 根据id查询题库
 */
export function getQuestionBankVOById(params: QuestionBankQueryRequest) {
  return request.get<QuestionBankVO>({
    url: apiPrefix + "/get/vo",
    params
  })
}
